package infra

var routers = [][]interface{}{}

func RegisterRouter(name string, route string, item ...interface{}) {
	var line = []interface{}{name, route}
	line = append(line, item...)
	routers = append(routers, line)
}

func ListRouter() interface{} {
	return routers
}

func ListNatRouter() interface{} {
	var nats = []interface{}{}
	for _, v := range routers {
		if v[0].(string) == "nats" {
			nats = append(nats, v)
		}
	}
	return nats
}

func ListIrisRouter() interface{} {
	var nats = []interface{}{}
	for _, v := range routers {
		if v[0].(string) == "web" {
			nats = append(nats, v)
		}
	}
	return nats
}
